package cn.tedu.micro.demo.order.controller;

import cn.tedu.micro.demo.common.protocol.JsonResult;
import cn.tedu.micro.demo.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    /**
     * POST
     * gunId userId
     * JsonResult<orderNO>
     */
    @PostMapping("/order/create")
    public JsonResult<String> orderCreate(Integer gunId,Integer userId){
        //调用业务 创建充电订单返回订单编号,提供给前端,追踪订单
        String billId=orderService.orderCreate(gunId,userId);
        return JsonResult.ok("ok",billId);
    }
}
